package org.example.repository;

import java.util.List;

public class RepositoryProxy<T extends Entity<?>> implements Repository<T> {

    private final Repository<T> target;

    public RepositoryProxy(Repository<T> target) {
        super();
        this.target = target;
    }

    @Override
    public List<T> find(Query query) {
        return target.find(query);
    }

    @Override
    public long count(Query query) {
        return target.count(query);
    }

    @Override
    public T findById(Object id) {
        return target.findById(id);
    }

    @Override
    public T findFirst(Query query) {
        return target.findFirst(query);
    }

    @Override
    public int add(T entity) {
        return target.add(entity);
    }

    @Override
    public int update(T entity, Condition where) {
        return target.update(entity, where);
    }

    @Override
    public void clear() {
        target.clear();
    }
}
